package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        Collection<String> c1=new ArrayList<>();
        c1.add("asdasd");
        c1.add("super");
        //c.add(55);



        String[]array={"one","two","three","four","five"};
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
        System.out.println("--------------");
        Collection c=new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        Iterator it=c.iterator();
        while (it.hasNext()){
            String str=(String) it.next();
            System.out.println(str);
        }
        System.out.println("-----------------");
        for (String array1:array){
            System.out.println(array1);
        }
        System.out.println("--------");
        for (Object obj:c){
            System.out.println(obj);
        }




    }
}
